cd "C:\Users\tbohmelt\Dropbox\Coups Spatial\PSRM Paper\2_Final Version\PSRM Replication\"

* Note: set working directory according to your location of the files.

 set matsize 8000
 
use "Monadic Baseline.dta", clear

spatwmat using "inverse_coup", name(W)standardize
splagvar couprisk1, wname(W) wfrom(Stata)
rename wy_couprisk1 wy_inverse_coup

spatwmat using "inverse_coup_lost", name(W)standardize
splagvar couprisk1, wname(W) wfrom(Stata)
rename wy_couprisk1 wy_inverse_coup_lost

spatwmat using "Joint_Demo II.dta", name(W)standardize
splagvar couprisk1, wname(W) wfrom(Stata)
rename wy_couprisk1 wy_demo

global Y effective_number

global X couprisk1 polity2 durable ny_gdp_pcap_kd sp_pop_totl fuel_i war_total army_centrality lag_DV country_fe2-country_fe145 year_fe2- year_fe30

reg $Y $X wy_inverse_coup, vce(bootstrap, rep(1000))
reg $Y $X wy_inverse_coup_lost, vce(bootstrap, rep(1000))
reg $Y $X wy_demo, vce(bootstrap, rep(1000))
reg $Y $X wy_inverse_coup wy_demo, vce(bootstrap, rep(1000))
reg $Y $X wy_inverse_coup_lost wy_demo, vce(bootstrap, rep(1000))

